// 单组柱状图
export const singularColumnTemplate = ({ size, data, color, autoRotate, yField, yTitle }) => {
    const { width, height } = size
    return {
        autoFit: false,
        width,
        height,
        maxColumnWidth: 14,
        appendPadding: 24,
        data,
        isGroup: true,
        xField: 'label',
        yField: yField || 'value',
        color,
        label: {
            position: 'top',
            style: { fill: '#FFFFFF', opacity: 1 },
        },
        legend: {
            layout: 'horizontal',
            position: 'top',
            offsetX: -24,
            itemName: { style: { fill: 'white', fontSize: 12 } },
        },
        xAxis: {
            label: { style: { fill: '#B2FBFD' }, autoRotate },
            line: { style: { stroke: '#B2FBFD' } },
            tickLine: { style: { stroke: '#B2FBFD' } },
        },
        yAxis: {
            title: {
                text: yTitle || '',
                position: 'end',
                autoRotate: false,
                offset: 50,
                style: { fill: '#B2FBFD' },
            },
            tickCount: 5,
            label: { style: { fill: '#B2FBFD' } },
            grid: { line: { style: { stroke: 'rgba(178, 251, 253, 0.2)', lineDash: [8, 2] } } },
        },
        scrollbar: {
            type: 'horizontal',
            categorySize: 60,
            style: {
                trackColor: 'rgba(178, 251, 253, 0.2)',
                thumbColor: 'rgba(178, 251, 253, 1)',
                thumbHighlightColor: '#367EF2',
            },
        },
    }
}
